package com.ssm;

import com.ssm.socket.SocketModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.ApplicationContext;

import java.net.ServerSocket;

@SpringBootApplication
public class ServerSocketModelApplication extends SpringBootServletInitializer {



    public static void main(String [] args) {
        ApplicationContext applicationContext =
                SpringApplication.run(ServerSocketModelApplication.class, args);
        applicationContext.getBean(SocketModel.class).acceptData();
    }

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        return builder.sources(ServerSocketModelApplication.class);
    }
}
